<template>
	<div>
		<!--表格操作项目-->
		<table class="table" cellspacing="0" cellpadding="0">
			<tbody>
				<tr>
					<th>模块</th>
					<th style="">文件</th>
					<th>描述</th>
					<th style="width: 70px;">状态码</th>
					<th style="width: 50px;">行号</th>
					<th>url</th>
					<th>ip</th>
					<th>时间</th>
				</tr>
			</tbody>
			<tbody>
				<tr v-for="(item,index) in allResourcesData" :key="index">
					<td>{{ item.mode }}</td>
					<td class="o-h">{{ item.file }}</td>
					<td>{{ item.message }}</td>
					<td>{{item.code}}</td>
					<td>{{ item.line }}</td>
					<td>{{ item.url }}</td>
					<td>{{ item.ip }}</td>
					<td>{{item.create_time}}</td>
				</tr>
			</tbody>
		</table>
		<!-- 分页 -->
		<div class="padding-t-20">
			<a-pagination :pageSize="queryParams.pageSize" :current="queryParams.page" :total="queryParams.count"
				@change="clickPage" :pageSizeOptions="pageSizeOptions" show-size-changer
				@showSizeChange="onShowSizeChange" show-quick-jumper />
		</div>
	</div>
</template>

<script>
	import rizhiApi from '../../api/rizhi.js'
	export default {
		data() {
			return {
				// 分页
				pageSizeOptions: ['20', '50', '100', '150', '300'],
				// 所有数据
				allResourcesData: [],
				queryParams: {
					invite_id: '',
					user_name: '',
					phone: '',
					start_time: '',
					end_time: '',
					status: '',
					count: '',
					page: 1,
					pageSize: 20,
				}
			}
		},
		mounted() {
			this.allResources();
		},
		methods: {
			allResources() {
				rizhiApi.getErrLog(this.queryParams.page, this.queryParams.pageSize).then((res) => {
					this.allResourcesData = res.result.data
					this.queryParams.count = res.result.count;
				})
			},
			// 分页
			clickPage(e) {
				this.queryParams.page = e;
				this.allResources();
			},
			onShowSizeChange(current, pageSize) {
				this.queryParams.pageSize = pageSize;
				this.queryParams.page = 1;
				this.allResources();
			},
		},
	}
</script>

<style>

</style>
